<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>22-树形组件</title>
    <script src="../js/vue.js"></script>
    <script src="../element-ui/lib/index.js"></script>
    <link rel="stylesheet" href="../element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<el-tree :data="treeData">
</el-tree>
</div>
<script>
    const vm = new Vue({
        el: "#app",
        data: {
            treeData:[
                {
                    id:"1",
                    label:"会员管理",
                    children:[
                        {
                            id:"1.1",
                            label:"VIP会员",
                        },
                        {
                            id:"1.2",
                            label:"非VIP会员",
                        },
                    ]
                },
                {
                    id:"2",
                    label: "商品管理",
                    children: [
                        {
                            id:"2.1",
                            label:"厨具管理",
                            children:[
                                {
                                    id:"2.1.1",
                                    label:"筷子",
                                },
                                {
                                    id:"2.1.2",
                                    label:"刀",
                                },
                                {
                                    id:"2.1.2",
                                    label:"碗",
                                },
                            ],
                        },
                        {
                            id:"2.2",
                            label: "电器管理",
                        }
                    ],
                }
            ],


        },
        methods: {},
    });
</script>
</body>
</html>